//
//  LBOrderRemarkView.m
//  loveBeen
//
//  Created by 郭小双 on 16/11/23.
//  Copyright © 2016年 loveBeen. All rights reserved.
//

#import "LBOrderRemarkView.h"
@interface LBOrderRemarkView()
@end
@implementation LBOrderRemarkView
- (IBAction)clickBtn:(UIButton *)sender {
    
    sender.selected = YES;
    sender.userInteractionEnabled = NO;
    
    NSString *preStr = self.textView.text;
    
    self.textView.text = [preStr stringByAppendingFormat:@"%@ ",sender.titleLabel.text];
    
    self.lb_message.hidden = YES;

    NSInteger fontCount = self.textView.text.length;
    
    
    [self.lb_count setText:[NSString stringWithFormat:@"还可以输入%@字符",@(300 - fontCount)]];
}






-(void)awakeFromNib{
    [super awakeFromNib];
    
  
    
    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tap)];
    
    [self.textView addGestureRecognizer:tap];
    
    [self CustomisFirstResponder];
    
}

-(void)tap{
    [self CustomisFirstResponder];

}

-(void)CustomisFirstResponder{
    
    [self.textView becomeFirstResponder];
    
    if([self.textView isFirstResponder])
    {
        self.lb_message.hidden = YES;
    }
}

- (IBAction)back:(UIButton *)sender {
    
    NSString *str = self.textView.text;
    
    NSDictionary *dic = @{@"text":str};
    [[NSNotificationCenter defaultCenter]postNotificationName:@"backValue" object:nil userInfo:dic];

}


@end
